package com.otitan.la.forest.system.util;

import com.alibaba.fastjson.JSON;

import java.util.List;

/**
 * @Description: 共同工具类
 * @Author: jiachangsen
 * @CreateDate: 2020/06/28 17:30
 * @UpdateUser: jiachangsen
 * @UpdateDate: 2020/06/28 17:30
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
public class CommonUtil {

    /**
     * 从List<A>copy到List<B>
     *
     * @param [list, clazz]
     * @return java.util.List<T>
     * @throws
     * @author Sunke
     * @date 2020/9/18 0018 11:16
     */
    public static <T> List<T> copy(List<?> list, Class<T> clazz) {
        String oldOb = JSON.toJSONString(list);
        return JSON.parseArray(oldOb, clazz);
    }


}
